


const float TABLE[][2] =
{
    //===============================
    // added by BOSS
    {0.0f,   35.00f },
    {28.00f, 35.10f},
    {29.00f, 35.20f},
    {30.00f, 35.30f},
    {30.00f, 35.40f},
    // --------------------------
	{31.00f, 35.40f},
	{31.20f, 35.60f},
	{31.40f, 35.70f},
	{31.60f, 35.80f},
	{31.80f, 35.90f},
	{32.00f, 36.00f},
	{32.20f, 36.00f},
	{32.40f, 36.10f},
	{32.60f, 36.20f},
	{32.80f, 36.30f},
	{33.00f, 36.40f},
	{33.20f, 36.50f},
	{33.40f, 36.60f},
	{33.60f, 36.60f},
	{33.80f, 36.60f},
	{34.00f, 36.70f},
	{34.20f, 36.70f},
	{34.40f, 36.70f},
	{34.60f, 36.70f},
	{34.80f, 36.90f},
	{35.00f, 37.00f},
	{35.20f, 37.20f},
	{35.40f, 37.40f},
	{35.60f, 37.60f}, 
	{35.80f, 37.70f},
	{36.00f, 37.80f},
	{36.20f, 38.00f},
	{36.60f, 38.10f},
	{36.80f, 38.20f},
	{37.00f, 38.40f},
	{37.20f, 38.50f},
	{37.40f, 38.70f},
	{37.60f, 38.90f},
	{37.80f, 39.10f},
	{38.00f, 39.20f},
	{38.20f, 39.30f},
	{38.40f, 39.50f},
	{38.60f, 39.60f},
	{38.80f, 39.70f},
};

int cst1117_convert(float src, float* result)
{
    int i;
    int maxcount = sizeof(TABLE)/sizeof(TABLE[0]);
    
    if( src < TABLE[0][0] )
    {
        return 1;
    }

    for( i = 1; i < maxcount; i ++)
    {
        if( src < TABLE[i][0] )
        {
            break;
        }
    }
    if( i < maxcount )
    {
        *result = TABLE[i-1][1];
        return 0;
    }
    return 1;
}
